<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AgentInterfaceTest</title>

<link rel="stylesheet"
	href="http://code.jquery.com/qunit/qunit-1.15.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.15.0.js"></script>

<script src="../../main/js/util/JavaScriptAugments.js"></script>
<script src="../../main/js/util/Logger.js"></script>
<script src="../../main/js/util/ArrayUtilities.js"></script>
<script src="../../main/js/util/InputValidator.js"></script>

<script src="../../main/js/Team.js"></script>
<script src="../../main/js/Position.js"></script>
<script src="../../main/js/Maneuver.js"></script>
<script src="../../main/js/ShipAction.js"></script>
<script src="../../main/js/Ship.js"></script>
<script src="../../main/js/Path.js"></script>
<script src="../../main/js/RangeRuler.js"></script>
<script src="../../main/js/Weapon.js"></script>
<script src="../../main/js/Pilot.js"></script>
<script src="../../main/js/Token.js"></script>
<script src="../../main/js/PlanningAction.js"></script>
<script src="../../main/js/DamageCard.js"></script>
<script src="../../main/js/Environment.js"></script>
<script src="../../main/js/SquadBuilder.js"></script>
<script src="../../main/js/SimpleAgent.js"></script>

<script src="../../main/js/ui/ImageUtilities.js"></script>
<script src="../../main/js/ui/HumanAgent.js"></script>

<script>
    var LOGGER = new Logger();

    QUnit
            .test("Agent interface",
                    function(assert)
                    {
                        // Setup.
                        var name = "myAgent";
                        var team = Team.IMPERIAL;
                        var squadBuilder = CoreSetImperialSquadBuilder;
                        var imageUtils = new ImageUtilities();

                        var agent0 = new SimpleAgent(name + "0", team,
                                squadBuilder);
                        var agent1 = new HumanAgent(name + "1", team,
                                squadBuilder, imageUtils);
                        var agents = [ agent0, agent1 ];

                        // Run / Verify.
                        for (var i = 0; i < agents.length; i++)
                        {
                            var agent = agents[i];

                            // Verify the functions exist.
                            assert.ok(agent.buildSquad, (typeof agent)
                                    + ".buildSquad");
                            assert.ok(agent.getName, agent.getName() + ".getName");
                            assert.ok(agent.getTeam, agent.getName() + ".getTeam");
                            assert.ok(agent.getSquadBuilder, agent.getName()
                                    + ".getSquadBuilder");
                            assert.ok(agent.getPlanningAction, agent.getName()
                                    + ".getPlanningAction");
                            assert.ok(agent.getShipAction, agent.getName()
                                    + ".getShipAction");
                            assert.ok(agent.chooseWeaponAndDefender, agent.getName()
                                    + ".chooseWeaponAndDefender");
                            assert.ok(agent.getModifyAttackDiceAction, agent.getName()
                                    + ".getModifyAttackDiceAction");
                            assert.ok(agent.getModifyDefenseDiceAction, agent.getName()
                                    + ".getModifyDefenseDiceAction");
                        }
                    });
</script>
</head>
<body>
	<div id="qunit"></div>
</body>
</html>
